package com.jvtd.eyl.utils;

import android.content.Context;

import com.jvtd.utils.FileUtils;
import com.liulishuo.filedownloader.FileDownloadSampleListener;
import com.liulishuo.filedownloader.FileDownloader;

/**
 * 下载工具类
 *
 * 作者:chenlei
 * 时间:2018/11/15 9:37 AM
 */
public class DownloadUtils
{
  public static void downloadPdf(Context context, String url, String fileType, FileDownloadSampleListener fileDownloadSampleListener)
  {
    FileDownloader.getImpl().create(url)
        .setPath(FileUtils.getFilePath(context, url, String.format(".%s", fileType)), false)
        .setCallbackProgressTimes(300)
        .setMinIntervalUpdateSpeed(400)
        .setListener(fileDownloadSampleListener).start();
  }
}
